package com.ayf.payment.game.api.utils;


import com.ayf.payment.game.api.exception.BusinessException;

/**
 * 校验数据有效性工具类
 * @author lch
 * @date 2021/9/19
 */
public class ValidateUtil {



    /**
     * 校验条件是否符合，如果不符合则抛出业务异常
     * @author lch
     * @date 2021/7/28
     */
    public static void businessValidate(boolean condition, String message) {
        if (!condition) {
            throw new BusinessException(message);
        }
    }

    public static void businessValidate(boolean condition, int code, String message) {
        if (!condition) {
            throw new BusinessException(code, message);
        }
    }

}
